package com.app.outdoor.InvoikeServices;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;

public class BaseInvoike {
	protected static String post(String url,ArrayList<NameValuePair> params) throws Exception{
		HttpClient client=new DefaultHttpClient();
		HttpPost post=new HttpPost(url);
		StringBuffer bf=new StringBuffer();
		
			
			post.setEntity(new UrlEncodedFormEntity(params));
			HttpResponse response=client.execute(post);
			
			BufferedReader br=new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
			String line="";
			
			while((line=br.readLine())!=null){
				bf.append(line+'\n');
			}
		
		return bf.toString();
	}
}
